package com.coffee.core.enums;

public enum SkuOrderTypeEnum {
    BUY("buy", "购买"),
    OFFLINE("offline", "线下支付"),
    PERIODIZATION("periodization", "分期购"),
    BALANCE("balance", "余额支付"),
    ENJOY("enjoy", "先享后付");

    private String code;
    private String name;

    private SkuOrderTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static SkuOrderTypeEnum getByCode(String code) {
        for (SkuOrderTypeEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }

        return null;
    }
}
